package classrecord.classes.database.common;

import java.io.Serializable;

import classrecord.classes.database.studentnumbertbl.STUDENTNUMBERTBLDomain;

public interface IEveryTableDao extends Serializable {

	/* ***** Insert a new record. *********************************************
	 * [1]: All columns involve in the record insertion must have values
	 * 		otherwise, the record insertion will not succeed. 
	 * [2]: When trying to insert a record that is already inserted,
	 * 		SQLite Driver for Java (SQLiteJDBC.jar) will not notify you.
	 * ***********************************************************************/
	public boolean add();
	
	/* ***** Update the details of a record. **********************************
	 * [1]: No corresponding physicalUpdate() method. No column, other than the
	 * 		STUDENT_NUMBER, should be modified or updated in the STUDENTNUMBERTBL
	 * 		even if the account used to access the record is an admin account.
	 * ***********************************************************************/
	public boolean update();
	
	/* ***** Physically delete a record. **************************************
	 * [1]: Think for 7 times before calling this.
	 * [2]: Only the administrator account is advised to call and use this method.
	 * [3]: The administrator should sure that the deletion of the record have
	 * 		no effects on the other tables otherwise, read again Note[1].
	 * [4]: Once the record has been physically deleted, it is effectively
	 * 		non existent in the table.
	 * ***********************************************************************/
	public boolean physicalDelete();

	
	/* ***** Logically delete a record. ***************************************
	 * [1]: Seek for an administrator's advise before doing a call on this method.
	 * [2]: The record will not be deleted, but this will set its 
	 * 		LOGICAL_DELETE_FLAG to 1, making it irretrievable during logical
	 * 		record retrieval and counting.
	 * ***********************************************************************/
	public boolean logicalDelete();
	

	/* ***** Determine Physical Record Count. *********************************
	 * [1]: The Physical Record Count is the actual count of the records
	 * 		existing in the table.
	 * ***********************************************************************/
	public int getPhysicalRecordCount();
	
	
	/* ***** Determine Logical Record Count. **********************************
	 * [1]: The Logical Record Count is the logical count of the records
	 * 		existing in the table.
	 * [2]: This method is used to determine the count of logical records
	 * 		with corresponding link to a main table.
	 * 		Example of main table linked to other tables:
	 * 		Main Table: STUDENTNUMBERTBL
	 * 		With Link: STUDENTEMAILADDRESSTBL, STUDENTHOMEADDRESSTBL, 
	 * 		STUDENTMOBILEPHONENUMBERTBL, STUDENTNAMETBL, STUDENTTELEPHONENUMBERTBL
	 * ***********************************************************************/
	public int getLogicalRecordCount();

}
